package com.sannuo.manager.controller;

import com.sannuo.common.domain.DrugStore;
import com.sannuo.common.domain.Role;
import com.sannuo.common.result.Result;
import com.sannuo.common.result.ResultCode;
import com.sannuo.manager.service.ChaxService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/chax")
@RestController
@Api(tags = "",description ="" )
@CrossOrigin
public class ChaxController {

    @Autowired
    private ChaxService chaxService;

    @RequestMapping("drug")
    public Result druglistfin(){
        List<DrugStore> drug = chaxService.dauglist();
        System.out.println(drug);
        return Result.ok(ResultCode.SUCCESS,drug);
    }

    @RequestMapping("role")
    public Result rolefin(){
        List<Role> roles = chaxService.rolelist();
        System.out.println(roles);
        return Result.ok(ResultCode.SUCCESS,roles);
    }
}
